package com.hecn.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author 陈朋康
 * @site hecn.gitee.io
 * @discription
 */
@Controller
//@RequestMapping("/HelloController")
public class HelloController {
    @RequestMapping("/hello")
    public String hello(Model model) {
        //向模型中添加属性msg与值，可以在JSP页面中取出并渲染
        model.addAttribute("msg", "Hello,SpringMVC");
        //web-inf/jsp/hello.jsp
        return "hello";
    }

}
